//建立数据库表格式
const mongoose = require("mongoose");
const Schema = mongoose.Schema;

//create Schema
const UserSchema = new Schema({
    username: {
        type: String,
        required: true
    },
    password: {
        type: String,
        required: true
    },
    mobile: {
        type: Number,
        default: null
    },
    email: {
        type: String,
        default: null
    },
    token: {
        type: String,
        default: null
    },
    date: {
        type: Date,
        default: Date.now
    },
    updateDate: {
        type: Date,
        default: null
    }
});

const modelUsers = mongoose.model("users", UserSchema);

module.exports = modelUsers;
